<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
        var user={
            name:'zhangsan',
            birth:2000,
            age:function (){
                //今年-出生年月
                var now = new Date().getFullYear();
                return now- this.birth;
            }
    }
        //属性              user.name
        //方法 一定要带括号   user.age()
        //this. 代表
</script>
</body>
</html>